package com.yfp.client.mapper;

import com.yfp.client.domain.Client;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 客户Mapper
 *
 * @CreateDate: 2024/5/16 9:59
 * @UpdateUser:
 * @UpdateDate: 2024/5/16 9:59
 * @UpdateRemark: 暂无修改
 * @Version: 1.0
 */
@Mapper
public interface ClientMapper {
    Client getById(String id);

    Client getByOpenId(String openId);

    void insert(Client client);

    Client findByMobile(String mobile);

    void edit(Client client);

    void clearOpenId(String id);
    void clearMobile(String id);

    List<Client> clientList();

    /**
     * 根据id集合查询客户信息
     *
     * @param clientIdList
     * @return
     */
    List<Client> getByIds(List<String> clientIdList);

    /**
     * 剩余抽奖次数
     * @param clientId
     * @return
     */
    Integer lotteryNum(String clientId);

    /**
     * 修改支付密码
     *
     * @param id
     * @param payPassword
     */
    void updatePayPassword(@Param("id") String id, @Param("payPassword") String payPassword);

    /**
     * 修改免密支付按钮状态
     *
     * @param id
     * @param payPasswordFree
     */
    void updatePasswordFree(@Param("id") String id, @Param("payPasswordFree") Integer payPasswordFree);

    /**
     * 清空储值余额
     * @param clientId
     */
    void emptyBalance(String clientId);

    /**
     * 扣除余额和赠送金
     * @param client
     */
    void deductMoneyAndGiftGold(Client client);

    /**
     * 抽奖次数-1
     * @param clientId
     */
    void updateLotteryNum(String clientId);

    /**
     * 用户打点位标签
     * @param clientId
     * @param positionId
     */
    void updatePositionId(@Param("clientId") String clientId, @Param("positionId") String positionId);

    void returnIntegral(@Param("clientId") String clientId, @Param("integral") Long integral);

}
